var cols = 7;
var obj = {
	nombre : "",
	titulo : "",
	url : "",
	orden : 0,
	padre : null,
	visible : false,
	admin : false
}

function getCabecera() {
	var row = "<thead>";
	row = row + "<tr class=\"cabecera\">";
	row = row + "<th>Nombre</th>";
	row = row + "<th>T&iacute;tulo</th>";
	row = row + "<th>Direcci&oacute;n</th>";
	row = row + "<th>Orden</th>";
	row = row + "<th>Padre</th>";
	row = row + "<th>Visible</th>";
	row = row + "<th>Administraci&oacute;n</th>";
	row = row + "</tr>";
	row = row + "</thead>";
	return row;
}

function getFila(data) {
	var row = "<tr class=\"fila\">";
	row = row + "<td class=\"tdelemento\" id=\"col1_" + data.id + "\">"
			+ data.nombre + "</td>";
	row = row + "<td class=\"tdelemento\" id=\"col2_" + data.id + "\">"
			+ data.titulo + "</td>";
	row = row + "<td class=\"tdelemento\" id=\"col3_" + data.id + "\">" + data.url
			+ "</td>";
	row = row + "<td class=\"tdelemento\" id=\"col4_" + data.id + "\">" + data.orden
			+ "</td>";
	if (data.padre != null && data.padre != "") {
		row = row + "<td class=\"tdelemento\" id=\"col5_" + data.id
				+ "\"><p id=\"col51_" + data.id + "\">" + data.padre.nombre;
		row = row + "</p><input type=\"hidden\" id=\"col52_" + data.id
				+ "\" name=\"padre_" + id + "\" value=\"" + data.padre.id
				+ "\">";
		row = row + "</td>";
	} else {
		row = row + "<td class=\"tdelemento\" id=\"col5_" + data.id
				+ "\"><p id=\"col51_" + data.id + "\">&nbsp;";
		row = row + "</p><input type=\"hidden\" id=\"col52_" + data.id
				+ "\" name=\"padre_" + data.id + "\" value=\"" + "\">";
		row = row + "</td>"
	}
	
	row = row + "<td class=\"tdelemento\" id=\"col6_" + data.id + "\">";
	row = row + "<input type=\"checkbox\" id=\"col61_" + data.id
			+ "\" name=\"visible_" + data.id + "\" value=\"true\"";
	if (data.visible)
		row = row + " checked=\"checked\"";
	row = row + ">";
	
	row = row + "<td class=\"tdelemento\" id=\"col7_" + data.id + "\">";
	row = row + "<input type=\"checkbox\" id=\"col71_" + data.id
			+ "\" name=\"visible_" + data.id + "\" value=\"true\"";
	if (data.admin)
		row = row + " checked=\"checked\"";
	row = row + ">";
	
	row = row + "</td>";
	row = row + "</tr>";
	return row;
}